const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");
const { ethers } = require("hardhat");

const TestTokensModule = buildModule("TestTokens", m => {
  const mintAmount = ethers.parseEther("1000");

  const tokenA = m.contract("Token", ["TestTokenA", "TTA", mintAmount], { id: "TTA" });
  const tokenB = m.contract("Token", ["TestTokenB", "TTB", mintAmount], { id: "TTB" });

  return { tokenA, tokenB };
});

const FakeDexModule = buildModule("FakeDex", m => {
  const fakeDex = m.contract("FakeDex", []);

  return { fakeDex };
});

const FakeLendingModule = buildModule("FakeLending", m => {
  const profitAmount = ethers.parseEther("1");
  const fakeLending = m.contract("FakeLending", [profitAmount]);

  return { fakeLending };
});

module.exports = { TestTokensModule, FakeDexModule, FakeLendingModule };
